package com.qys.livesMall.shop.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qys.livesMall.shop.modal.dto.ShopGoodsStockDto;
import com.qys.livesMall.shop.modal.entity.ShopGoodsSku;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * sku库存 Mapper 接口
 * </p>
 *
 * @author gmx
 * @since 2023-06-07
 */
@Mapper
public interface ShopGoodsSkuMapper extends BaseMapper<ShopGoodsSku> {

    BigDecimal getPostage(@Param("skuIds") List<Long> skuIds);

    List<ShopGoodsSku> getRandSkus(@Param("shopId") Long shopId, @Param("size") int limit);

    Page<ShopGoodsStockDto> stockZeroShopGoodsPage(@Param("page") Page<ShopGoodsStockDto> page, @Param("shopId") Long shopId,@Param("status") boolean status);

    List<Long> getLivesSessionForSku(Long skuId, List<String> liveIds);

    ShopGoodsSku getSkuByGoods(@Param("shopGoodsIds") List<Long> shopGoodsIds,@Param("amount") BigDecimal amount,@Param("shopId") Long shopId);


}
